<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>我的首页</title>
        <script type="text/javascript" src="/socket.io/socket.io.js"></script>
        <script type="text/javascript" src="/js/jquery-1.6.min.js"></script>
        <script type="text/javascript">
	        var socket = io.connect('http://localhost:6060');
	        socket.on('connect', function (data) {
	          console.log(data);
	        });
	        socket.emit('test', { msg: 'data' });
	        socket.on('msg', function(data){alert(data['m']);});
	        function sendMsg(){
	        	var msg = $('#msg').val();
	        	socket.emit('sendMsg', {'msg':msg});
	        }
        </script>
    </head>
    <body>
        <a href="/blog">博客</a>
        <a href="/user">用户</a>
        <a href="/pic">照片</a>
        <input name="msg" id="msg" type="text"/><input type="button" onclick='sendMsg()' value='提 交'/>
    </body>
</html>
